-
Notifications
You must be signed in to change notification settings - Fork 277
Documentation of lazy loading v1 [DOC-38] #2803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation of lazy loading v1 [DOC-38] #2803
Conversation
jbmc/src/java_bytecode/README.md
Outdated
|
||
To be documented. | ||
\ref java_bytecode_languaget::typecheck calls [java_bytecode_convert_class](\ref java_bytecode_languaget::java_bytecode_convert_class) (for each class loaded by the class loader) to create symbols for all classes and the methods in them. The methods, along with their parsed representation (including bytecode) are also added to a map called \ref java_bytecode_languaget::method_bytecode via a reference held in \ref java_bytecode_convert_classt::method_bytecode. typecheck then performs a switch over the value of [lazy_methods_mode](\ref java_bytecode_languaget::lazy_methods_mode). If lazy_methods_mode is \ref lazy_methods_modet::LAZY_METHODS_MODE_CONTEXT_INSENSITIVE then context-insensitive lazy loading is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have lines broken at 80 characters? It's much easier to read diffs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link for typecheck
jbmc/src/java_bytecode/README.md
Outdated
|
||
To be documented. | ||
\ref java_bytecode_languaget::typecheck calls [java_bytecode_convert_class](\ref java_bytecode_languaget::java_bytecode_convert_class) (for each class loaded by the class loader) to create symbols for all classes and the methods in them. The methods, along with their parsed representation (including bytecode) are also added to a map called \ref java_bytecode_languaget::method_bytecode via a reference held in \ref java_bytecode_convert_classt::method_bytecode. typecheck then performs a switch over the value of [lazy_methods_mode](\ref java_bytecode_languaget::lazy_methods_mode). If lazy_methods_mode is \ref lazy_methods_modet::LAZY_METHODS_MODE_CONTEXT_INSENSITIVE then context-insensitive lazy loading is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link for typecheck
jbmc/src/java_bytecode/README.md
Outdated
To be documented. | ||
\ref java_bytecode_languaget::typecheck calls [java_bytecode_convert_class](\ref java_bytecode_languaget::java_bytecode_convert_class) (for each class loaded by the class loader) to create symbols for all classes and the methods in them. The methods, along with their parsed representation (including bytecode) are also added to a map called \ref java_bytecode_languaget::method_bytecode via a reference held in \ref java_bytecode_convert_classt::method_bytecode. typecheck then performs a switch over the value of [lazy_methods_mode](\ref java_bytecode_languaget::lazy_methods_mode). If lazy_methods_mode is \ref lazy_methods_modet::LAZY_METHODS_MODE_CONTEXT_INSENSITIVE then context-insensitive lazy loading is used. | ||
|
||
Context-insensitive lazy loading is an alternative method body loading strategy to eager loading, which is selected when lazy_methods_mode is \ref java_bytecode_languaget::LAZY_METHODS_MODE_EAGER. Under eager loading \ref java_bytecode_languaget::convert_single_method(const irep_idt &, symbol_table_baset &) is called once for each method listed in method_bytecode (described above). This then calls \ref java_bytecode_languaget::convert_single_method(const irep_idt &, symbol_table_baset &, optionalt<ci_lazy_methods_neededt>) without a ci_lazy_methods_neededt object, which calls java_bytecode_convert_method, passing in the method parse tree. This in turn uses java_bytecode_convert_methodt to turn the bytecode into symbols for the parameters and local variables and finish populating the symbol for the method, including converting the instructions to a codet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turn all identifiers into links (entire document)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just first occurrence of each reference or every one?
Suggest adding a short section prior to all this close-up technical detail that briefly describes the strategies without citing particular method names. Eager loading simply loads every method belonging to classes found in the first phase; lazy loading starts at the method given by the |
dc3e785
to
6c05a85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 6c05a85).
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
jbmc/src/java_bytecode/README.md
Outdated
have been converted, their parameters and local variables, globals accessed | ||
from these methods and classes are kept, everything else is thrown away. This | ||
leaves a symbol table that contains reachable symbols fully populated, | ||
including the instructions for methods converted to a codet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ref codet
6c05a85
to
be8e0b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: be8e0b3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84138811
jbmc/src/java_bytecode/README.md
Outdated
To be documented. | ||
\section java-bytecode-lazy-methods-v1 Context-Insensitive lazy methods (aka lazy methods v1) | ||
|
||
Eager loading simply loads every method belonging to classes found in the first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear what Eager Loading is. I think it would be clearer to make this section about Loading Strategies and have subsections for Eager Loading and Context-Insensitive Lazy Methods. If you don't want to do that, at least have a first sentence which introduces Eager Loading.
14b095b
to
d411a2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More suggestions to improve it, but it's good enough that you could just merge it if you want.
jbmc/src/java_bytecode/README.md
Outdated
\section loading-strategies Loading strategies | ||
|
||
Loading strategies are policies that determine what classes and method bodies | ||
are loaded. On an inital pass, the symbols for all classes in all paths on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inital -> initial
jbmc/src/java_bytecode/README.md
Outdated
Loading strategies are policies that determine what classes and method bodies | ||
are loaded. On an inital pass, the symbols for all classes in all paths on the | ||
Java classpath are loaded. Eager loading is a policy that then loads method | ||
bodies for every one of these classes and for all the method bodies in these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence doesn't make sense to me... we load all the method bodies for all the method bodies...
jbmc/src/java_bytecode/README.md
Outdated
Context-insensitive lazy loading starts at the method given by the `--function` | ||
argument and follows type references (e.g. in the definitions of fields and | ||
method parameters) and function references (at function call sites) to | ||
locate further classes and methods to load. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line and the two above are indented by a space
jbmc/src/java_bytecode/README.md
Outdated
method parameters) and function references (at function call sites) to | ||
locate further classes and methods to load. | ||
|
||
If [lazy_methods_mode](\ref java_bytecode_languaget::lazy_methods_mode) is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence seems out of place here. Would it be better at the beginning of this subsection? The first few sentences of this subsection don't really flow, like they were written separately and put together later.
d411a2a
to
d85ed15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: d85ed15).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84322492
No description provided.